package com.example.shiwu;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

import com.example.shiwu.view.MainInfoView;

public class MainInfoActivity extends AppCompatActivity{

    private MainInfoView mainInfoView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maininfo);
//        mainInfoView = new MainInfoView(this, R.layout.activity_maininfo);
//        mainInfoView.createView();
        //initView();
    }
//
//    public void initView() {
//        mainInfoView = new MainInfoView(this, R.layout.activity_maininfo);
//    }
    @Override
    public void onBackPressed() {
        // 判断当前显示的是subFragment
        System.out.println("============= onBackPressed =============");
    //    if (currentFragment instanceof SubFragment) {
    //        // 返回时不进入默认页，而是显示otherFragment
    //        switchFragment(otherFragment);
    //    } else {
    //        // 其他情况执行默认返回（如退出应用）
    //        super.onBackPressed();
    //    }
    }

}